<template>
    <div class="comment-list">
        <div class="cmt-item" v-for="cmt in item" :key="cmt.commentId">
            <div class="cmt-head">
                <img :src="cmt.user.avatarUrl">
            </div>
            <div class="cmt-wrap">
                <div class="cmt-hearder">
                    <div class="cmt-meta">
                        <span class="cmt-user">{{cmt.user.nickname}}</span>
                        <div class="cmt-time">{{cmt.timeStr}}</div>
                    </div>
                    <div class="cmt-like">
                        {{cmt.likedCount}}
                        <i><img src="../assets/givelike.svg" alt=""></i>
                    </div>
                </div>
                <div class="cmt-content">
                    <span class="cmt-text">{{cmt.content}}</span>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    props:{
        item:Array
    }
}
</script>
<style lang="less" scoped>
.comment-list{
    .cmt-item{
        padding-top: 10px;
        width: 100%;
        display: flex;
        .cmt-head{
            height: 35px;
            margin: 0px 10px;
            &>img{
                display: block;
                border-radius: 50%;
                width: 30px;
                height: 30px;
            }
        }
        .cmt-wrap{
            padding: 0 10px 10px 0;
            flex: 1 1 auto;
            position: relative;
            .cmt-hearder{
                display: flex;
                .cmt-meta{
                    // width: 0;
                    flex: auto;
                    .cmt-user{
                        width: 0px;
                        flex: auto;
                        font-size: 14px;
                        color: #666;
                        line-height: 20px;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        white-space: nowrap;
                    }
                    .cmt-time{
                        font-size: 9px;
                        color: #999;
                    }
                }
                .cmt-like{
                    // width: 65px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    height: 22px;
                    line-height: 22px;
                    font-size: 14px;
                    color: #999;
                    -webkit-box-flex: 0;
                    flex: none;
                    text-align: right;
                    vertical-align: middle;
                    &>i{
                        display: inline-block;
                        width: 14px;
                        height: 14px;
                        margin-left: 6px;
                        line-height: 0;
                        vertical-align: middle;
                        cursor: pointer;
                    }
                }
            }
            .cmt-content{
                position: relative;
                 margin-top: 5px;
                .cmt-text{
                    color: #333;
                    font-size: 15px;
                    line-height: 22px; 
                }
            }
            &::after {
                position: absolute;
                content: "";
                border: 0 solid rgba(0, 0, 0, 0.1);
                bottom: 0;
                left: 0;
                box-sizing: border-box;
                width: 100%;
                border-bottom-width: 1px;
            }
        }
    }
}
</style>